package club.hicode.daydayup.redis.jedis;

import org.junit.Test;
import org.springframework.data.redis.core.RedisTemplate;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * Redis Test
 *
 * @author Liu Chunfu
 * @date 2018-05-04 上午11:18
 **/
public class JRedisTest {


    @Test
    public void test1() {

        JedisPoolConfig poolConfig = new JedisPoolConfig();
        poolConfig.setMaxTotal(100);
        poolConfig.setMaxWaitMillis(10 * 1000);
        JedisPool pool = new JedisPool(poolConfig, "127.0.0.1", 16379);
        Jedis jedis = pool.getResource();
        jedis.set("p:name", "刘纯夫2");
        jedis.setex("p:id", 10, "901117");

        String s = jedis.get("p:name");
        System.out.println(s);
    }


}
